package com.xiguaji.tiktok.v1.product.dto;

import com.xiguaji.tiktok.v1.product.model.Product;
import lombok.Data;
import org.mapstruct.Mapper;

import java.math.BigDecimal;
import java.util.List;

@Data
public class ProductResponse {
    private Long id;
    private String name;
    private BigDecimal price;
    private Integer number;
    private Integer level;
    private Boolean enable;
    private Double discount;
    private Double halfYearDiscount;
    private Double yearDiscount;
    private Double halfYearPrice;
    private Double yearPrice;
    private Double deductMoney;
    private Double deductPrice;
    private Double deductHalfYearPrice;
    private Double deductYearPrice;
    private String validUntil;
    private String halfYearValidUntil;
    private String yearValidUntil;
    private String icon;
    private String description;


    @Mapper(componentModel = "spring")
    public interface ProductMapper{
        ProductResponse mapper(Product product);

        List<ProductResponse> mapper(List<Product> products);
    }
}
